package http_routers

import (
	"net/http"
	// "PackingScanApp/view_body"
	// "fmt"
	// "github.com/dtylman/gowd"
)

//此为协程，需要捕获异常
func NewHTTP() {
	defer func() {
		if err := recover(); err != nil {
			// fmt.Sprintf("%s", err)
			// view_body.GetHtmlBody().SystemMsg = "<b>" + fmt.Sprintf("%s", err) + "</b>"
			// view_body.GetBodyCChan().DoShowBody <- 1
		}
	}() //--
	http.HandleFunc("/do.g", handleFunc) //设置html服务
	//绑定服务器地址结构
	if err := http.ListenAndServe("localhost:8888", nil); err != nil {
		panic(err)
	}
}
